<!DOCTYPE html>
<html>
<#assign ctx=springMacroRequestContext.contextPath />
<head>
<title>文件预览</title>
<#include "/header.html">

	<style type="text/css">
		.ztree{
			border-radius:4px;
			border: 1px solid #ddd;
			overflow: auto;
		}
		.row{padding-top:10px;}
		.test-wrap {
			width: 100%;
			overflow: auto;
			border: none;
			
		}
		#fileContent{
			padding:0;
			border: 1px solid #ddd;
			border-radius:4px;
			min-height: 200px;
			width: 100%
		}
	</style>
</head>
<body>
		<div id="autocodeapp" v-cloak>
			<input class="form-control" type="hidden" id="filePath" value="${filePath}">
			<div v-show="showList">
				<div class="grid-btn">
					<a class="btn btn-primary" onclick="history.go(-1)"><i class="fa fa-chevron-left"></i>&nbsp;返回</a>
					<a class="btn btn-primary" @click="exportCode"><i class="fa fa-download"></i>&nbsp;导出代码</a>
					<span class="label label-info">操作提示：点击左侧文件可在右侧预览文件内容</span>
					<span style="margin-left:20px;">
						<label class="radio-inline">
							<input type="radio" @click="changeFormat" name="isFormat" value="1" checked="checked"/>格式化
						</label>
						<label class="radio-inline">
							<input type="radio" @click="changeFormat" name="isFormat" value="0"/>未格式化
						</label>
					</<span>
					<a style="margin-left:20px;cursor: pointer;" @click="copyCode">&nbsp;复制代码</a>
				</div>
				<div class="row">
					<div class="col-sm-4 col-md-4 sidebar">
						<ul id="fileTree" class="ztree"></ul>
					</div>
					<div class="col-sm-8 col-md-8">
						<div class="table-responsive container" id="fileContent" ></div>
						<div class="table-responsive container" style="display: none;" id="fileContentText" >
							<textarea></textarea>
						</div>
					</div>
				</div>
		</div>
	    <div style="display: none;">
			<form action="${ctx}/export/doExportFromPath.htm" method="post" id="exportForm">
				<input type="hidden" name="codeFullPath" value="${filePath}" />
			</form>
		</div>
		<script src="${ctx}/js/fileView.js?_${.now?long}"></script>
</body>
</html>